<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .Box {
            width: 300px;
            height: 400px;
            margin: 100px auto;
            border: 1px solid bisque;
            box-shadow: 10px 10px 15px bisque;
            display: flex;
            flex-direction: column;
        }

        .selBox {
            height: 200px;
            /* background-color: skyblue; */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .selBox select {
            width: 200px;
            height: 50px;
            margin: 10px 0;
            background-color: bisque;
            border-radius: 5px;
            font-size: 16px;
        }

        .selBox select:focus {
            outline: none;
            background-color: rgb(250, 205, 150);
        }

        .ipt {
            flex: 1;
            /* background-color: pink; */
            display: flex;
            align-items: center;
            justify-content: center;
            display: flex;
            flex-direction: column;
        }

        .inputBox {

            position: relative;
        }

        input, button {
            margin: 10px 0;
        }

        input {
            width: 156px;
            height: 48px;
            font-size: 14px;
            border-radius: 5px;
            padding-left: 40px;
            border: 1px solid #c8cccf;
            color: #434547;
            outline: 0;
        }

        span {
            width: 25px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border-right: 1px solid #c8cccf;
            position: absolute;
            top: 21px;
            left: 4px;
        }

        button {
            width: 100px;
            height: 50px;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            background-color: cornflowerblue;
            outline: none;
        }

        button:active {
            background-color: rgba(45, 92, 223);
        }
    </style>
</head>

<body>
<div class="Box">
    <div class="selBox">
        <select class="selectSF" id="remitterCardNo">
            <option>请选择付款人</option>
        </select>
        <select class="selectSF" id="payeeCardNo">
            <option>请选择收款人</option>
        </select>
    </div>
    <div class="ipt">
        <div class="inputBox">
            <span>￥</span>
            <input type="text" placeholder="请输入转账金额" id="money">
        </div>
        <button onclick="submit()">转账</button>
    </div>
</div>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script>
    $(document).ready(function () {
        $.get("/bank", function (data, status) {
            if (data !== undefined && data !== '') {
                for (let i = 0; i < data.length; i++) {
                    $(".selectSF").append(`<option value="${data[i].banCardNo}">${data[i].name + '-' + data[i].banCardNo}</option>`)
                }
            }
        });
    })

    function submit() {
        var remitterCardNo = $("#remitterCardNo").val()
        var payeeCardNo = $("#payeeCardNo").val()
        var money = $("#money").val()
        let param = {remitterCardNo,payeeCardNo,money}
        console.log(param)
        // $.post({
        //     url: '/bank',
        //     contentType: 'json/application;charset=utf-8;',
        //     data: param,
        //     success: function (data) {
        //         console.log(data)
        //     }
        // })
        $.post("/bank", {remitterCardNo,payeeCardNo,money},
            function (data, status) {
                alert("数据: \n" + data + "\n状态: " + status);
            })
    }
</script>
</body>
</html>
